home *** CD-ROM | disk | FTP | other *** search
/ Financial Peace University Interactive Bonus / Financial Peace University Bonus Interactive CD-ROM.iso / pc / calculators / reality_check_new.swf / scripts / frame_74 / DoAction_8.as < prev    next >
Encoding:
Text File  |  2006-01-27  |  2.1 KB  |  76 lines

  1. txtMortgageAmount2.text = _global.MortgageAmount2;
  2. txtMortgageTerm2.text = _global.MortgageTerm2;
  3. txtMortgageTermRemaining2.text = _global.MortgageTermRemaining2;
  4. txtMortgageRate2.text = _global.MortgageRate2;
  5. focusManager.setFocus(txtMortgageAmount2);
  6. _global.validate = function()
  7. {
  8.    var _loc2_ = 0;
  9.    if(isNaN(Number(txtMortgageAmount2.text)) == 1)
  10.    {
  11.       txtMortgageAmount2.setStyle("backgroundColor",16767449);
  12.       _loc2_ += 1;
  13.    }
  14.    if(isNaN(Number(txtMortgageTerm2.text)) == 1 || Number(txtMortgageTerm2.text) > 30)
  15.    {
  16.       txtMortgageTerm2.setStyle("backgroundColor",16767449);
  17.       _loc2_ += 1;
  18.    }
  19.    if(isNaN(Number(txtMortgageTermRemaining2.text)) == 1 || Number(txtMortgageTermRemaining2.text) > Number(txtMortgageTerm2.text))
  20.    {
  21.       txtMortgageTermRemaining2.setStyle("backgroundColor",16767449);
  22.       _loc2_ += 1;
  23.    }
  24.    if(isNaN(Number(txtMortgageRate2.text)) == 1 || Number(txtMortgageRate2.text) > 20)
  25.    {
  26.       txtMortgageRate2.setStyle("backgroundColor",16767449);
  27.       _loc2_ += 1;
  28.    }
  29.    if(_loc2_ == 0)
  30.    {
  31.       if(isNaN(Number(txtMortgageAmount2.text)) == 0)
  32.       {
  33.          _global.MortgageAmount2 = Number(txtMortgageAmount2.text);
  34.       }
  35.       else
  36.       {
  37.          _global.MortgageAmount2 = 0;
  38.       }
  39.       if(isNaN(Number(txtMortgageTerm2.text)) == 0)
  40.       {
  41.          _global.MortgageTerm2 = Number(txtMortgageTerm2.text);
  42.       }
  43.       else
  44.       {
  45.          _global.MortgageTerm2 = 0;
  46.       }
  47.       if(isNaN(Number(txtMortgageTermRemaining2.text)) == 0)
  48.       {
  49.          _global.MortgageTermRemaining2 = Number(txtMortgageTermRemaining2.text);
  50.       }
  51.       else
  52.       {
  53.          _global.MortgageTermRemaining2 = 0;
  54.       }
  55.       if(isNaN(Number(txtMortgageRate2.text)) == 0)
  56.       {
  57.          _global.MortgageRate2 = Number(txtMortgageRate2.text);
  58.       }
  59.       else
  60.       {
  61.          _global.MortgageRate2 = 0;
  62.       }
  63.       if(_global.MortgageQty == 3)
  64.       {
  65.          gotoAndStop("Q3c");
  66.          play();
  67.       }
  68.       else
  69.       {
  70.          gotoAndStop("Q4");
  71.          play();
  72.       }
  73.    }
  74. };
  75. stop();
  76.